//
// CTextContext.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;

public class CTextContext {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CTextContext(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextContext obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextContext(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CTextContext() {
    this(nel3dJNI.new_CTextContext(), true);
  }

  public void init(IDriver drv, CFontManager fmg) {
    nel3dJNI.CTextContext_init(swigCPtr, this, IDriver.getCPtr(drv), drv, CFontManager.getCPtr(fmg), fmg);
  }

  public CFontManager getFontManager() {
    long cPtr = nel3dJNI.CTextContext_getFontManager(swigCPtr, this);
    return (cPtr == 0) ? null : new CFontManager(cPtr, false);
  }

  public void setFontGenerator(String fontFileName, String fontExFileName) {
    nel3dJNI.CTextContext_setFontGenerator__SWIG_0(swigCPtr, this, fontFileName, fontExFileName);
  }

  public void setFontGenerator(String fontFileName) {
    nel3dJNI.CTextContext_setFontGenerator__SWIG_1(swigCPtr, this, fontFileName);
  }

  public CFontGenerator getFontGenerator() {
    long cPtr = nel3dJNI.CTextContext_getFontGenerator(swigCPtr, this);
    return (cPtr == 0) ? null : new CFontGenerator(cPtr, false);
  }

  public void setColor(CRGBA color) {
    nel3dJNI.CTextContext_setColor(swigCPtr, this, CRGBA.getCPtr(color), color);
  }

  public void setFontSize(long fontSize) {
    nel3dJNI.CTextContext_setFontSize(swigCPtr, this, fontSize);
  }

  public void setHotSpot(CComputedString.THotSpot hotSpot) {
    nel3dJNI.CTextContext_setHotSpot(swigCPtr, this, hotSpot.swigValue());
  }

  public void setScaleX(float scaleX) {
    nel3dJNI.CTextContext_setScaleX(swigCPtr, this, scaleX);
  }

  public void setScaleZ(float scaleZ) {
    nel3dJNI.CTextContext_setScaleZ(swigCPtr, this, scaleZ);
  }

  public void setShaded(boolean b) {
    nel3dJNI.CTextContext_setShaded(swigCPtr, this, b);
  }

  public void setShadeExtent(float shext) {
    nel3dJNI.CTextContext_setShadeExtent(swigCPtr, this, shext);
  }

  public void setShadeColor(CRGBA color) {
    nel3dJNI.CTextContext_setShadeColor(swigCPtr, this, CRGBA.getCPtr(color), color);
  }

  public void setKeep800x600Ratio(boolean keep) {
    nel3dJNI.CTextContext_setKeep800x600Ratio(swigCPtr, this, keep);
  }

  public CRGBA getColor() {
    return new CRGBA(nel3dJNI.CTextContext_getColor(swigCPtr, this), true);
  }

  public long getFontSize() {
    return nel3dJNI.CTextContext_getFontSize(swigCPtr, this);
  }

  public CComputedString.THotSpot getHotSpot() {
    return CComputedString.THotSpot.swigToEnum(nel3dJNI.CTextContext_getHotSpot(swigCPtr, this));
  }

  public float getScaleX() {
    return nel3dJNI.CTextContext_getScaleX(swigCPtr, this);
  }

  public float getScaleZ() {
    return nel3dJNI.CTextContext_getScaleZ(swigCPtr, this);
  }

  public boolean getShaded() {
    return nel3dJNI.CTextContext_getShaded(swigCPtr, this);
  }

  public boolean getKeep800x600Ratio() {
    return nel3dJNI.CTextContext_getKeep800x600Ratio(swigCPtr, this);
  }

  public CRGBA getShadeColor() {
    return new CRGBA(nel3dJNI.CTextContext_getShadeColor(swigCPtr, this), true);
  }

  public long textPush(String format) {
    return nel3dJNI.CTextContext_textPush__SWIG_0(swigCPtr, this, format);
  }

  public long textPush(SWIGTYPE_p_ucstring str) {
    return nel3dJNI.CTextContext_textPush__SWIG_1(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(str));
  }

  public void erase(long index) {
    nel3dJNI.CTextContext_erase(swigCPtr, this, index);
  }

  public void clear() {
    nel3dJNI.CTextContext_clear(swigCPtr, this);
  }

  public void printAt(float x, float z, long index) {
    nel3dJNI.CTextContext_printAt__SWIG_0(swigCPtr, this, x, z, index);
  }

  public void printClipAt(CRenderStringBuffer rdrBuffer, float x, float z, long index, float xmin, float ymin, float xmax, float ymax) {
    nel3dJNI.CTextContext_printClipAt(swigCPtr, this, CRenderStringBuffer.getCPtr(rdrBuffer), rdrBuffer, x, z, index, xmin, ymin, xmax, ymax);
  }

  public void printClipAtUnProjected(CRenderStringBuffer renderBuffer, CFrustum frustum, SWIGTYPE_p_NLMISC__CMatrix scaleMatrix, float x, float y, float depth, long index, float xmin, float ymin, float xmax, float ymax) {
    nel3dJNI.CTextContext_printClipAtUnProjected(swigCPtr, this, CRenderStringBuffer.getCPtr(renderBuffer), renderBuffer, CFrustum.getCPtr(frustum), frustum, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(scaleMatrix), x, y, depth, index, xmin, ymin, xmax, ymax);
  }

  public void printAt(float x, float z, SWIGTYPE_p_ucstring ucstr) {
    nel3dJNI.CTextContext_printAt__SWIG_1(swigCPtr, this, x, z, SWIGTYPE_p_ucstring.getCPtr(ucstr));
  }

  public void printfAt(float x, float z, String format) {
    nel3dJNI.CTextContext_printfAt(swigCPtr, this, x, z, format);
  }

  public CComputedString getComputedString(long index) {
    long cPtr = nel3dJNI.CTextContext_getComputedString(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CComputedString(cPtr, false);
  }

  public void computeString(String s, CComputedString output) {
    nel3dJNI.CTextContext_computeString__SWIG_0(swigCPtr, this, s, CComputedString.getCPtr(output), output);
  }

  public void computeString(SWIGTYPE_p_ucstring s, CComputedString output) {
    nel3dJNI.CTextContext_computeString__SWIG_1(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CComputedString.getCPtr(output), output);
  }

  public void computeStringInfo(SWIGTYPE_p_ucstring s, CComputedString output) {
    nel3dJNI.CTextContext_computeStringInfo(swigCPtr, this, SWIGTYPE_p_ucstring.getCPtr(s), CComputedString.getCPtr(output), output);
  }

  public void dumpCache(String filename) {
    nel3dJNI.CTextContext_dumpCache(swigCPtr, this, filename);
  }

  public void setLetterColors(CLetterColors letterColors, long index) {
    nel3dJNI.CTextContext_setLetterColors(swigCPtr, this, CLetterColors.getCPtr(letterColors), letterColors, index);
  }

  public boolean isSameLetterColors(CLetterColors letterColors, long index) {
    return nel3dJNI.CTextContext_isSameLetterColors(swigCPtr, this, CLetterColors.getCPtr(letterColors), letterColors, index);
  }

}
